package com.hust;


import com.github.pagehelper.PageInfo;
import com.hust.service.CommodityService;
import com.hust.service.SubscribeService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;

@RunWith(SpringRunner.class)
@SpringBootTest
@WebAppConfiguration
public class testFindHistoryByUrl {

    @Autowired
    private CommodityService commodityService;

    @Autowired
    private SubscribeService subscribeService;

    @Test
    public void testFindHistoryByUrl(){
        PageInfo historyByUrl = commodityService.findHistoryByUrl(3, "www.baidu.com");
        System.out.println(historyByUrl);
    }

    @Test
    public void testAddSubscribe(){
        boolean sub_flag = subscribeService.addSubscribe(1457757074, "1457757074@qq.com", 1024L, "290");
        System.out.println(sub_flag);
    }

    @Test
    public void testFindTop5Hot(){
        PageInfo top5Hot = commodityService.findTop5Hot();
        System.out.println(top5Hot);
    }
}
